import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
Window {
    width: 640
    height: 480
    visible: true
    title: qsTr("Hello World")

    Rectangle {
        anchors.fill: parent
        color: "transparent"

        ColumnLayout {
            anchors.fill: parent
            spacing: 20

            RowLayout {
                Layout.fillWidth: true
                height: 30
                spacing: 20

                Button {
                    id: leftBtn
                    height: 25
                    width: 96
                    text: "向左旋转"
                    onClicked: {
                        image.leftFaceDegrees()
                    }
                }

                Button {
                    id: rightBtn
                    height: 30
                    width: 96
                    text: "向右旋转"
                    onClicked: {
                        image.rightFaceDegrees()
                    }
                }


                Button {
                    id: upDownMirrorBtn
                    height: 30
                    width: 96
                    text: "上下镜像"
                    onClicked: {
                        image.upDownFaceMirror()
                    }
                }

                Button {
                    id: leftRightMirrorBtn
                    height: 30
                    width: 96
                    text: "左右镜像"

                    ColorAnimation {
                        from: "green"
                        to: "red"
                        duration: 200
                    }

                    onClicked: {
                        image.leftRightFaceMirror()
                    }
                }
            }

            Imageview {
                id: image
                Layout.fillWidth: true
                Layout.fillHeight: true
            }
        }

    }
}
